//
//  CarTeamCell.m
//  阿帕
//
//  Created 阿帕 on 2019/12/28.
//  Copyright © 2019 GCY. All rights reserved.
//

#import "CarTeamCell.h"

@interface CarTeamCell ()
@property (weak, nonatomic) IBOutlet UIImageView *selectedImageView;
@property (weak, nonatomic) IBOutlet UIImageView *avatarImageView;
@property (weak, nonatomic) IBOutlet UILabel *teamNameLabel;
@property (weak, nonatomic) IBOutlet UIView *lineView;
@property (weak, nonatomic) IBOutlet UILabel *teamDesLabel;
@end

@implementation CarTeamCell

- (void)awakeFromNib {
    [super awakeFromNib];
    
    cut(_avatarImageView, 40);
    _teamNameLabel.textColor = Dark_TextColor;
    _teamNameLabel.adjustsFontSizeToFitWidth = YES;
    _teamDesLabel.textColor = Light_TextColor;
    _lineView.backgroundColor = BackgroundColor;
    [_teamTelButton setTitleColor:Dark_TextColor forState:UIControlStateNormal];
    [_teamTelButton setImage:image(@"gcy_icon_carteam_tel") forState:UIControlStateNormal];
    [_teamTelButton layoutButtonWithEdgeInsetsStyle:MKButtonEdgeInsetsStyleLeft imageTitleSpace:5];
}

- (void)setModel:(CarTeamModel *)model {
    
    _model = model;
    
    if (model.isSelected == NO) {
        _selectedImageView.image = image(@"gcy_btn_siji_nomal");
    } else {
        _selectedImageView.image = image(@"btn_siji_selected");
    }
    
    _teamNameLabel.text = model.name;
    _teamDesLabel.text = model.linkMan;
    setNetImage(_avatarImageView, model.headImg, @"gcy_img_main_head");
    [_teamTelButton setTitle:model.phone forState:UIControlStateNormal];
    
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
